#pragma once

#include <stdint.h>
#include <string>

namespace book
{

class IndexItem
{
public:
    IndexItem() {}

    IndexItem(const IndexItem &b) = default;

    IndexItem(IndexItem &&b) = default;

    IndexItem &operator=(const IndexItem &b) = default;

    IndexItem &operator=(IndexItem &&b) = default;

    bool isDir() const {
        return isDir_;
    }

    bool isArticle() const {
        return !isDir_;
    }

    void setIsDir(bool isDir) {
        isDir_ = isDir;
    }

    const std::string &dirEntryName() const { return dirEntryName_; }

    void setDirEntryName(const std::string_view &dirEntryName) {
        dirEntryName_ = dirEntryName;
    }

    const std::string &uriName() const { return uriName_; }

    void setUriName(const std::string_view &uriName) {
        uriName_ = uriName;
    }

    const std::string &title() const { return title_; }

    void setTitle(const std::string_view &title) {
        title_ = title;
    }

private:
    bool isDir_ = false;
    std::string dirEntryName_;
    std::string uriName_;
    std::string title_;
};


} // namespace book
